'use strict'

const { TaiSpider, ItemLoader } = require('tai-spider');

const urls = [
    'https://www.space.com/space-force-x-37b-space-plane-otv-6-mission-ends',
    'https://www.space.com/x-37b-military-space-plane-900-days-orbit',
    'https://www.space.com/x-37b-military-space-plane-nears-mission-duration-record',
    'https://www.space.com/x-37b-space-plane-mission-duration-record',
    'https://www.space.com/x-37b-military-space-plane-surprising-facts',
    'https://www.space.com/x-37b-space-plane-500-days-in-orbit-otv-6-mission',
    'https://www.space.com/25275-x37b-space-plane.html',
    'https://www.space.com/x-37b-space-plane-solar-power-beaming',
    'https://www.space.com/x-37b-space-plane-space-force-otv-6-launch-success.html',
    'https://www.space.com/space-force-x-37b-space-plane-otv-6-weather-delay.html',
    
];

class CustomUrlsSpider extends TaiSpider {

    constructor(options = {}) {
        super(options);
        this.name = 'custom-urls';
        this.debug = true;
        this.start_urls = urls;
    }

    *parse(response) {
        yield Object.assign({
            index_name: 'tai-article',
        }, response.extract());
    }
}

module.exports = CustomUrlsSpider;